import {getDefaultConfig} from '@rainbow-me/rainbowkit';
import {defineChain} from 'viem';
import {arbitrum, base, mainnet, optimism, polygon} from 'wagmi/chains';

const juChain = defineChain({
  id: 202599,
  name: 'JuChain',
  nativeCurrency: {
    decimals: 18,
    name: 'JuChain',
    symbol: 'JU',
  },
  rpcUrls: {
    default: {
      http: ['https://testnet-rpc.juchain.org'],
    },
    public: {
      // 推荐添加 public 字段
      http: ['https://testnet-rpc.juchain.org'],
    },
  },
  blockExplorers: {
    default: {
      name: 'JuChain Explorer',
      url: 'https://testnet-scan.juchain.org', // 替换为实际浏览器URL
    },
  },
  testnet: true, // 明确标记是否为测试网
});

export const config = getDefaultConfig({
  appName: 'RainbowKit demo',
  projectId: import.meta.env.VITE_WC_PROJECT_ID,
  chains: [juChain, mainnet, polygon, optimism, arbitrum, base],
});
